
using System;
using System.Collections.Generic;
using Abp.Application.Services;
using L._52ABP.Application.Dtos;
using L._52ABP.Common.Extensions.Enums;

using Yozeev.DataExporting.Excel.Epplus;
using Yozeev.DataFileObjects.DataTempCache;
using Yozeev.BusinessLogic.Dtos;


namespace Yozeev.BusinessLogic.Exporting
{
    /// <summary>
    /// 的视图模型根据业务需要可以导出为Excel文件
    /// </summary>
	[RemoteService(IsEnabled = false)]
    public class TicketRoleListExcelExporter : EpplusExcelExporterBase, ITicketRoleListExcelExporter
    {       
        /// <summary>
        /// 构造函数，需要继承父类
        /// </summary>
        /// <param name="dataTempFileCacheManager"></param>
        public TicketRoleListExcelExporter(IDataTempFileCacheManager dataTempFileCacheManager):base(dataTempFileCacheManager)
        {

        }
        public FileDto ExportToExcelFile(List<TicketRoleListDto> ticketRoleListDtos)
        {

    var fileExportName = L("TicketRoleList") + DateTime.Now.ToString("yyyyMMddHHmmss") + ".xlsx";

            var excel =
                 CreateExcelPackage("fileExportName", excelpackage =>
               {
                   var sheet = excelpackage.Workbook.Worksheets.Add(L("TicketRoles"));

                   sheet.OutLineApplyStyle = true;
			AddHeader(sheet,L("RoleId"),L("Role"),L("TicketPriceId"),L("TicketPrice"));
            AddObject(sheet, 2, ticketRoleListDtos
             ,ex => ex.RoleId 
             ,ex => ex.Role 
             ,ex => ex.TicketPriceId 
             ,ex => ex.TicketPrice 
                   );

							//// custom codes
									
							

							//// custom codes end
	  });
    return excel;
        }
    }
}
